package com.sg.controller.bff;

import com.sg.service.biz.bff.TaskGenService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "TaskGen", tags = {"TaskGen"})
@RestController
// @RequestMapping("/oms/taskGen/")
public class TaskGenController {
    @Autowired
    TaskGenService taskGenService;

    /**
     * B3-2批量增一级指标定时汇报任务调度(管理)
     * gen by moon at 8/29/2022, 12:48:53 PM
     */
    @PostMapping("/oms/mgt/taskGen/batchAddFristTargetObjTimerReportTaskPlan")
    @ApiOperation(value = "B3-2批量增一级指标定时汇报任务调度(管理)", response = OkrResult.class)
    public OkrResult<BffBatchAddFristTargetObjTimerReportTaskPlanRespDto> batchAddFristTargetObjTimerReportTaskPlan(@RequestBody(required = false) @Validated BffBatchAddFristTargetObjTimerReportTaskPlanReqDto reqDTO) {
        return OkrResult.success(taskGenService.batchAddFristTargetObjTimerReportTaskPlan(reqDTO));
    }

    /**
     * B3-更新目标内容目标周期名称等调度（人工真实测试）
     * gen by moon at 9/22/2022, 8:48:02 AM
     */
    @PostMapping("/oms/taskGen/refreshTargetContCycleNameEtcPlan")
    @ApiOperation(value = "B3-更新目标内容目标周期名称等调度（人工真实测试）", response = OkrResult.class)
    public OkrResult<BffRefreshTargetContCycleNameEtcPlanRespDto> refreshTargetContCycleNameEtcPlan(@RequestBody(required = false) @Validated BffRefreshTargetContCycleNameEtcPlanReqDto reqDTO) {
        return OkrResult.success(taskGenService.refreshTargetContCycleNameEtcPlan(reqDTO));
    }

    /**
     * B3-2查询定时任务调度列表(管理)
     * gen by moon at 11/22/2022, 8:49:16 PM
     */
    @PostMapping("/oms/mgt/taskGen/queryTimerTaskPlanList")
    @ApiOperation(value = "B3-2查询定时任务调度列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTimerTaskPlanListRespDto> queryTimerTaskPlanList(@RequestBody(required = false) @Validated BffQueryTimerTaskPlanListReqDto reqDTO) {
        return OkrResult.success(taskGenService.queryTimerTaskPlanList(reqDTO));
    }

    /**
     * B3-2查询定时任务调度详情(管理)
     * gen by moon at 11/18/2022, 7:34:08 PM
     */
    @PostMapping("/oms/mgt/taskGen/queryTimerTaskPlanDetail")
    @ApiOperation(value = "B3-2查询定时任务调度详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTimerTaskPlanDetailRespDto> queryTimerTaskPlanDetail(@RequestBody(required = false) @Validated BffQueryTimerTaskPlanDetailReqDto reqDTO) {
        return OkrResult.success(taskGenService.queryTimerTaskPlanDetail(reqDTO));
    }

}

